package cn.iocoder.yudao.module.xkfz.controller.admin.excel.result;

import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;

import java.util.HashMap;
import java.util.List;

/**
 * @Description excel查询专用，添加了表头信息返回字段
 * @Author ZWC
 * @Date 2024/5/23 17:26
 */
@Data
public class CommonExcelResult<T> extends CommonResult<T> {

    List<HashMap<String, String>> headerList;

    public static <T> CommonExcelResult<T> success(T data,List<HashMap<String, String>> headerList) {
        CommonExcelResult<T> result = new CommonExcelResult<>();
        result.setCode(GlobalErrorCodeConstants.SUCCESS.getCode());
        result.setData(data);
        result.setMsg("");
        result.setHeaderList(headerList);
        return result;
    }
}
